package com.training.bean.dao;

import com.training.api.repository.AppVersionRepository;
import com.training.bean.AppVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class AppVersionDTO {
    
    @Autowired
    private AppVersionRepository appVersionRepository;
    
    public AppVersion findLatestVersion() {
        return appVersionRepository.findLatestVersion();
    }
    
    public AppVersion save(AppVersion appVersion) {
        return appVersionRepository.save(appVersion);
    }
    
    public AppVersion findById(Integer id) {
        return appVersionRepository.findById(id).orElse(null);
    }
}